{% macro component(config, localized) %}
    {% embed "system/embed/table/responsive-table.html.twig" %}
        {% block heading %}
            {% embed "system/embed/table/table-header-element.html.twig" %}
                {% block content %}
                    {{ localized.table.name | raw }}
                {% endblock %}
            {% endembed %}
            {% embed "system/embed/table/table-header-element.html.twig" %}
                {% block content %}
                    {{ localized.table.id | raw }}
                {% endblock %}
            {% endembed %}
            {% embed "system/embed/table/table-header-element.html.twig" %}
                {% block content %}
                    {{ localized.table.handles | raw }}
                {% endblock %}
            {% endembed %}
            {% embed "system/embed/table/table-header-element.html.twig" %}
                {% block content %}
                    {{ localized.table.phrases | raw }}
                {% endblock %}
            {% endembed %}
            {% embed "system/embed/table/table-header-element.html.twig" %}
                {% block content %}
                    {{ localized.table.onExist | raw }}
                {% endblock %}
            {% endembed %}
            {% embed "system/embed/table/table-header-element.html.twig" with {textAlign: 'bc-text-center'} %}
                {% block content %}
                    {{ localized.table.status | raw }}
                {% endblock %}
            {% endembed %}
            {% embed "system/embed/table/table-header-element.html.twig" with {textAlign: 'bc-text-center'} %}
                {% import "system/macro/icons/trash.html.twig" as trash_icon %}
                {% block content %}
                    {{ trash_icon.component({}) }}
                {% endblock %}
            {% endembed %}
            {% embed "system/embed/table/table-header-element.html.twig" with {textAlign: 'bc-text-center'} %}
                {% import "system/macro/icons/edit.html.twig" as edit_icon %}
                {% block content %}
                    {{ edit_icon.component({}) }}
                {% endblock %}
            {% endembed %}
        {% endblock %}
        {% block body %}
            {% if config.scriptBlockers is empty %}
                <tr>
                    <td colspan="8" class="bc-py-4 bc-text-center">
                        {{ localized.alert.noScriptBlockerConfigured | raw }}
                    </td>
                </tr>
            {% else %}
                {% for scriptBlocker in config.scriptBlockers %}
                    {% embed "system/embed/table/table-body-row.html.twig" %}
                        {% block rowContent %}
                            {% embed "system/embed/table/table-body-element.html.twig" %}
                                {% block content %}
                                    {{ scriptBlocker.name }}
                                {% endblock %}
                            {% endembed %}
                            {% embed "system/embed/table/table-body-element.html.twig" %}
                                {% block content %}
                                    {{ scriptBlocker.key }}
                                {% endblock %}
                            {% endembed %}
                            {% embed "system/embed/table/table-body-element.html.twig" %}
                                {% block content %}
                                    {{ scriptBlocker.handles.list | column('key') | join(', ') }}
                                {% endblock %}
                            {% endembed %}
                            {% embed "system/embed/table/table-body-element.html.twig" %}
                                {% block content %}
                                    {{ scriptBlocker.phrases.list | column('value') | join(', ') }}
                                {% endblock %}
                            {% endembed %}
                            {% embed "system/embed/table/table-body-element.html.twig" %}
                                {% block content %}
                                    {{ scriptBlocker.onExist.list | column('value') | join(', ') }}
                                {% endblock %}
                            {% endembed %}
                            {% embed "system/embed/table/table-body-element.html.twig" with {textAlign: 'bc-text-center'} %}
                                {% import "system/macro/table/toggle-switch.html.twig" as toggle_switch %}
                                {% block content %}
                                    {{ toggle_switch.component({
                                        status: scriptBlocker.status,
                                        href:  wpNonceUrl("?page=#{config.controllerId}&action=switch-status&id=#{scriptBlocker.id}", "#{config.controllerId}-#{scriptBlocker.id}-switch-status")
                                    }) }}
                                {% endblock %}
                            {% endembed %}
                            {% embed "system/embed/table/table-body-element.html.twig" with {textAlign: 'bc-text-center'} %}
                                {% import "system/macro/icons/trash.html.twig" as trash_icon %}
                                {% block content %}
                                    {% if not scriptBlocker.undeletable %}
                                        <button
                                            data-brlbs-modal-target="{{ 'borlabsModalDelete-' ~ scriptBlocker.id }}">
                                            {{ trash_icon.component({}) }}
                                        </button>
                                        {% embed "system/embed/modal/modal.html.twig" with {
                                            action: wpNonceUrl("?page=#{config.controllerId}&action=delete&id=#{scriptBlocker.id}", "#{config.controllerId}-#{scriptBlocker.id}-delete"),
                                            buttonText: localized.global.button.delete,
                                            id: 'borlabsModalDelete-' ~ scriptBlocker.id,
                                            title: localized.global.headline.deleteSelection,
                                        } %}
                                            {% block description %}
                                                <p class="bc-text-sm"><strong>{{ localized.table.name | raw }}:</strong> {{ scriptBlocker.name }}</p>
                                                <p class="bc-text-sm"><strong>{{ localized.table.id | raw }}:</strong> {{ scriptBlocker.key }}</p>
                                            {% endblock %}
                                            {% block formData %}
                                                <input type="hidden" name="id" value="{{ scriptBlocker.id }}">
                                            {% endblock %}
                                        {% endembed %}
                                    {% else %}
                                        -
                                    {% endif %}
                                {% endblock %}
                            {% endembed %}
                            {% embed "system/embed/table/table-body-element.html.twig" with {textAlign: 'bc-text-center'} %}
                                {% import "system/macro/icons/edit.html.twig" as edit_icon %}
                                {% block content %}
                                    <a href="{{ wpNonceUrl("?page=#{config.controllerId}&action=edit&id=#{scriptBlocker.id}", "#{config.controllerId}-#{scriptBlocker.id}-edit") | raw }}">
                                        {{ edit_icon.component({}) }}
                                    </a>
                                {% endblock %}
                            {% endembed %}
                        {% endblock %}
                    {% endembed %}
                {% endfor %}
            {% endif %}
        {% endblock %}
    {% endembed %}
{% endmacro %}
